﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml;

/* Generated  */
namespace EDMXParserV1
{
        [Serializable]
    public class MappingFragment
    {
        public MappingFragment()
        {
            ScalarProperties = new List<ScalarProperty>();
        }
        public String StoreEntitySet { get; set; }
        public List<ScalarProperty> ScalarProperties { get; set; }


        public static MappingFragment New(System.Xml.XmlNode Node)
        {
            MappingFragment MappingFragment = new MappingFragment();
            foreach (XmlAttribute Attribute in Node.Attributes)
            {
                switch (Attribute.Name)
                {
                    case "StoreEntitySet":
                        MappingFragment.StoreEntitySet = Attribute.Value;
                        break;
                    default:
                        Globals.AttributeSwitchCoder(Attribute);
                        break;
                }

            }

            foreach (XmlNode ChildNode in Node.ChildNodes)
            {
                switch (ChildNode.Name)
                {
                    case "ScalarProperty":
                        ScalarProperty ScalarProperty = ScalarProperty.New(ChildNode);
                        MappingFragment.ScalarProperties.Add(ScalarProperty);
                        break;

                    default:
                        Globals.NodeSwitchCoder(ChildNode);
                        break;
                }
            }

            return MappingFragment;
        }
    }
}
